﻿using System.Data;
using VOL.Core.Configuration;

namespace VOL.WebApi
{
    public static class PurchasePub
    {
        //static string purchaseConn = AppSetting.PurchaseConnectionString;
        static string purchaseConn = "Data Source=113.219.212.5,10010;Initial Catalog=DASContract;Persist Security Info=True;User ID=nc;Password=nc123456;Connect Timeout=500;";
        public static int SqlExecute(string sql)
        {
           return  SqlHelper.SqlHelper.ExecuteNonQuery(purchaseConn,CommandType.Text,sql);

        }
         public static DataTable? SqlQuery(string sql)
        {
            DataTable dataTable = new DataTable();
            DataSet ds = new DataSet();
            ds = SqlHelper.SqlHelper.ExecuteDataset(purchaseConn, CommandType.Text, sql);
            if (ds != null)
            {
                return ds.Tables[0];
            }
            else
            {
                return null;
            }    

        }
    }
}
